import React from 'react'
// ===================================================================== Temp
import SearchForm from '#cpt/temp/SearchForm'
// ===================================================================== global declare
const { $fn, $Lazy } = window
// ===================================================================== $Lazy
const Page 		= $Lazy.load(()=>import('#tp/page/page-container-scroll'))
const $time 	= $Lazy.file(()=>import('@com/utils/time'))
// ===================================================================== component
class Index extends React.Component{
	state = {
		data:{},
		pag: {},
		// 搜索表单列表
		forms : [
			{ label:'生成时间',		names:['start_date','end_date'],	name:'jz-time',	type:'date-range', 	loading:true }
		],
	}
	componentDidMount(){
		$time.then(f=>{
			const arr = f.duration['1-now']()
			this.resetModel = { start_date: arr[0], end_date: arr[1], 'jz-time':arr }
			this.model = $fn.copy(this.resetModel)
			this.fetch()
		})
	}

	
	// paging
	fetch = () => $fn.fetch.call(this,'kd-report-spec/rpcheck', {callback: data => this.setState({data}) } )

	
	render(){
		const { data } = this.state
		return (
			<Page title='报告单未推送查询'>
				{/* 搜索 */}
				{ SearchForm.call(this, {timeStr:'1-now'}) }
				{/* 数据 */}
				<div className='h bor1 lh26 p10 mr10 ml10 mb10 f12' >
						<div className='g6 ' >
							<span className='tr ' style = {{width: '135px',display:'inline-block'}}>报告单查询平台数量 :</span>
							<b className='mlr10'>{ $fn.val(data.report_num) }</b>
						</div>
						<div className='g6' >
							<span className='tr ' style = {{width: '135px',display:'inline-block'}}>lis系统数量 :</span>
							<b className='mlr10'>{ $fn.val(data.lis_num) }</b>
						</div>
						<div className='g6' >
							<span className='tr ' style = {{width: '135px',display:'inline-block',verticalAlign: 'top'}}>缺少的报告单编号 :</span>
							<b className='mlr10' style={{width:' calc(100% - 160px)', display: 'inline-block'}}>{ $fn.val(data.items && data.items.join('，')) }</b>
						</div>
				</div>
			</Page>
		)
	}
}

export default Index